
*-----Figures Reported in Manuscript-----*
*Set working directory for entire analysis
*cd "~/Dropbox/Philips Souza Whitten/Data/Replication Files/"
version 14.0
qui foreach package in scheme-burd {
		capture which `package'
		if _rc==111 ssc install `package'
 	}
qui set scheme burd
capture net set ado SITE
capture net install clarify
ssc install sutex

//Capital to Labor Ratio (Figure 5):

use "Quick_Comparison.dta", clear
		set seed 784847


twoway line k_l year if year >1975 & year<2013 & country=="Brazil" , /*
*/lpattern(shortdash) lcolor(black) lwidth(medthick) || /*
*/ line k_l year if year >1975 & year<2013 & country=="Canada" , /*
*/lpattern(dot) lcolor(black) lwidth(medthick) || /*
*/ line k_l year if year >1975 & year<2013 & country=="Sweden" , /*
*/lpattern(solid) lcolor(black) lwidth(medthick) || /*
*/ line k_l year if year >1975 & year<2013 & country=="US" , /*
*/lpattern(solid) lcolor(gs10) lwidth(medthick) || /*
*/ ,  /*
*/ legend(label (1 "Brazil") label (2 "Canada") label(3 "Sweden") label(4 "United States")) /*
*/ scheme(burd) ytitle("Capital to Labor Ratio") xtitle("Year")

graph export "Figure_05.pdf", as(pdf) replace


//Brazil Comparison Between Standard Measures and Compositional Approach (Figure 6):
use "Brazil_Data.dta", clear
		set seed 784847
capture set scheme burd //Might have to download scheme burd

global nomissing "cgdpo_pc_growth != . & polariz != . & polconiii != . & agedep != . & execrlc != . & first_top != . & second_top != . & third_top != . & fourth_top != . & topminus1_top != ."

tsset year
keep if year >= 1976 & year <=2014
twoway line top1_i year if year>=1975, lcolor(black) lwidth(medthick) lpattern(shortdash_dot) ///
ytitle("Proportion of Income Share") xlabel(1975(10)2015) xtitle("Year") legend(off) ///
ylabel(0(5)55) name(single, replace)
graph save single.gph, replace


twoway line  firstquint year if $nomissing, lcolor(black) lpattern(solid) lwidth(medthick) ///
|| line secondquint year if $nomissing, lcolor(black) lpattern("---") lwidth(medthick)  || ///
line thirdquint year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || line ///
fourthquint year if $nomissing, lcolor(gs12) lpattern(solid) lwidth(medthick)  || line topdecileminus1 year if $nomissing, ///
lcolor(black) lpattern("....-") lwidth(medthick)  || line top1_i year if $nomissing, lcolor(black) ///
lpattern(shortdash_dot) lwidth(medthick) legend( symxsize(8) order(1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 ///
"80-99" 6 "Top 1") rows(1)) xtitle("Year") ytitle("Proportion of Income Share", height(10)) xlabel(1975(5)2015) ///
ylabel(0(5)50, nogrid) name(notsingle, replace) graphregion(style(none) fcolor(white) lcolor(white))
graph save notsingle.gph, replace

graph combine single notsingle, rows(1) xsize(5)

graph export "Figure_06.pdf", as(pdf) replace


//Results Figures
*---United States---*

*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(4.182561) sig(95) id(id)

*Open dynsimpie simulation results and graph them (Figure 8):
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))

graph export "Figure_08.pdf", as(pdf) replace

*---Canada---*

*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(11.18479) sig(95) id(id)

*Open dynsimpie simulation results and graph them (Figure 9):
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "Figure_09.pdf", as(pdf) replace
		
		
*---Sweden---*
		
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
		
*Run dynsimladderplot:	
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(13.00334) sig(95) id(id)

*Open dynsimpie simulation results and graph them (Figure 9):
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "Figure_10.pdf", as(pdf) replace
		
*---Brazil---*
		
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:		
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(4.600709) sig(95) id(id)

*Open dynsimpie simulation results and graph them (Figure 10):
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "Figure_11.pdf", as(pdf) replace	

		
		
		
		

*-----Tables and Figures Reported in Supplemental Appendix-----*

*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
global nomissing "Lowestfifth != . & Secondfifth != . & Thirdfifth != . & Fourthfifth != . & topfifthminus5 != . & Top5percent != . & cgdpo_pc_growth != . & polariz != . & execrlc != . & polconiii != . & agedep != ."

*Produce summary statistcs table for US data (Table 1)
sutex Lowestfifth Secondfifth Thirdfifth Fourthfifth topfifthminus5 Top5percent ///
tradeopen CAP100 econ_glob kaopen cgdpo_growth cgdpo_pc_growth polconiii polariz execrlc agedep if $nomissing, ///
lab nobs key(descstat) replace /// 
file(SI_Table_1.txt) title("Summary Statistics---US Dataset") minmax

*Produce two-way graphs showing our dependent variable as well as our alternative independent variables across time (Figure 1)
twoway line  Lowestfifth year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line Secondfifth year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line Thirdfifth year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium)  || line ///
Fourthfifth year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || line topfifthminus5 year if $nomissing, ///
lcolor(black) lpattern(longdash_3dot) lwidth(medthick)  || line Top5percent year if $nomissing, lcolor(black) ///
lpattern(shortdash) lwidth(medium) legend( symxsize(8) order(1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 ///
"80-94" 6 "Top 5") rows(1)) xtitle("Year") ytitle("Proportion of Income Share") xlabel(1975(5)2015) ///
ylabel(0.05(0.05)0.3, nogrid) name(g1, replace) graphregion(style(none) fcolor(white) lcolor(white)) title("Compositional DV")

twoway line tradeopen year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line econ_glob year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line globaliz year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium) || ///
line CAP100 year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || ///
line kaopen year if $nomissing, lcolor(black) lpattern(longdash_3dot) lwidth(medthick) ///
legend(symxsize(8) order(1 "Openness" 2 "KOF Econ" 3 "KOF" 4 "Quinn" 5 "KAO") rows(1)) ///
xtitle("Year") ytitle("Measure of Globalization") ///
xlabel(1975(5)2015) ylabel(0(10)100, nogrid) name(g2, replace) graphregion(fcolor(white) lcolor(white)) title("Measures of globalization")

gr combine g1 g2, rows(1) xsize(6) graphregion(fcolor(white) color(white))
graph export "SI_Figure_01.pdf", as(pdf) replace

*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
global nomissing "firstquint != . & secondquint != . & thirdquint != . & fourthquint != . & decile90 != . & decile100 != . & cgdpo_pc_growth != . & execrlc != . & agedep != . & polariz != . & polconiii != . & tradeopen != ."

*Produce summary statistcs table for Canada data (Table 2)
sutex firstquint secondquint thirdquint fourthquint decile90 decile100 ///
tradeopen CAP100 econ_glob kaopen cgdpo_growth cgdpo_pc_growth polconiii polariz execrlc agedep if $nomissing, ///
lab nobs key(descstat) replace /// 
file(SI_Table_2.txt) title("Summary Statistics---Canada Dataset") minmax

*Produce two-way graphs showing our dependent variable as well as our alternative independent variables across time (Figure 2)
twoway line  firstquint year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line secondquint year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line thirdquint year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium)  || line ///
fourthquint year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || line decile90 year if $nomissing, ///
lcolor(black) lpattern(longdash_3dot) lwidth(medthick)  || line decile100 year if $nomissing, lcolor(black) ///
lpattern(shortdash) lwidth(medium) legend( symxsize(8) order(1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 ///
"80-89" 6 "Top 10") rows(1)) xtitle("Year") ytitle("Proportion of Income Share") xlabel(1975(5)2015) ///
ylabel(0(5)30, nogrid) name(g1, replace) graphregion(style(none) fcolor(white) lcolor(white)) title("Compositional DV")

twoway line tradeopen year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line econ_glob year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line globaliz year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium) || ///
line CAP100 year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || ///
line kaopen year if $nomissing, lcolor(black) lpattern(longdash_3dot) lwidth(medthick) ///
legend(symxsize(8) order(1 "Openness" 2 "KOF Econ" 3 "KOF" 4 "Quinn" 5 "KAO") rows(1)) ///
xtitle("Year") ytitle("Measure of Globalization") ///
xlabel(1975(5)2015) ylabel(0(10)100, nogrid) name(g2, replace) graphregion(fcolor(white) lcolor(white)) title("Measures of globalization")

graph combine g1 g2, rows(1) xsize(6) graphregion(fcolor(white) color(white))
graph export "SI_Figure_02.pdf", as(pdf) replace

*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
global nomissing "firstquint != . & secondquint != . & thirdquint != . & fourthquint != . & decile90 != . & decile100 != . & cgdpo_pc_growth != . & polariz != . & tradeop != . & execrlc != . & cgdpo != . & polconiii != . & agedep != ."

*Produce summary statistcs table for Sweden data (Table 3)
sutex firstquint secondquint thirdquint fourthquint decile90 decile100 ///
tradeopen CAP100 econ_glob kaopen cgdpo_growth cgdpo_pc_growth polconiii polariz execrlc agedep if $nomissing, ///
lab nobs key(descstat) replace /// 
file(SI_Table_3.txt) title("Summary Statistics---Swedish Dataset") minmax

*Produce two-way graphs showing our dependent variable as well as our alternative independent variables across time (Figure 3)
twoway line  firstquint year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line secondquint year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line thirdquint year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium)  || line ///
fourthquint year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || line decile90 year if $nomissing, ///
lcolor(black) lpattern(longdash_3dot) lwidth(medthick)  || line decile100 year if $nomissing, lcolor(black) ///
lpattern(shortdash) lwidth(medium) legend( symxsize(8) order(1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 ///
"80-89" 6 "Top 10") rows(1)) xtitle("Year") ytitle("Proportion of Income Share") xlabel(1975(5)2015) ///
ylabel(0(5)30, nogrid) name(g1, replace) graphregion(style(none) fcolor(white) lcolor(white)) title("Compositional DV")

twoway line tradeopen year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line econ_glob year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line globaliz year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium) || ///
line CAP100 year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || ///
line kaopen year if $nomissing, lcolor(black) lpattern(longdash_3dot) lwidth(medthick) ///
legend(symxsize(8) order(1 "Openness" 2 "KOF Econ" 3 "KOF" 4 "Quinn" 5 "KAO") rows(1)) ///
xtitle("Year") ytitle("Measure of Globalization") ///
xlabel(1975(5)2015) ylabel(0(10)100, nogrid) name(g2, replace) graphregion(fcolor(white) lcolor(white)) title("Measures of globalization")

graph combine g1 g2, rows(1) xsize(6) graphregion(fcolor(white) color(white))
graph export "SI_Figure_03.pdf", as(pdf) replace

*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
global nomissing "firstquint != . & secondquint != . & thirdquint != . & fourthquint != . & topdecileminus1 != . & top1_i != . & cgdpo_pc_growth != . & polariz != ."

*Produce summary statistcs table for Sweden data (Table 4)
sutex firstquint secondquint thirdquint fourthquint topdecileminus1 top1_i ///
tradeopen CAP100 econ_glob kaopen cgdpo_growth cgdpo_pc_growth polconiii polariz execrlc agedep if $nomissing, ///
lab nobs key(descstat) replace /// 
file(SI_Table_4.txt) title("Summary Statistics---Brazilian Dataset") minmax

*Produce two-way graphs showing our dependent variable as well as our alternative independent variables across time (Figure 4)
twoway line  firstquint year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line secondquint year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line thirdquint year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium)  || line ///
fourthquint year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || line topdecileminus1 year if $nomissing, ///
lcolor(black) lpattern(longdash_3dot) lwidth(medthick)  || line top1_i year if $nomissing, lcolor(black) ///
lpattern(shortdash) lwidth(medium) legend( symxsize(8) order(1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 ///
"80-99" 6 "Top 1") rows(1)) xtitle("Year") ytitle("Proportion of Income Share") xlabel(1980(5)2015) ///
ylabel(0(5)30, nogrid) name(g1, replace) graphregion(style(none) fcolor(white) lcolor(white)) title("Compositional DV")

twoway line tradeopen year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line econ_glob year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line globaliz year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium) || ///
line CAP100 year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || ///
line kaopen year if $nomissing, lcolor(black) lpattern(longdash_3dot) lwidth(medthick) ///
legend(symxsize(8) order(1 "Openness" 2 "KOF Econ" 3 "KOF" 4 "Quinn" 5 "KAO") rows(1)) ///
xtitle("Year") ytitle("Measure of Globalization") ///
xlabel(1980(5)2015) ylabel(0(10)100, nogrid) name(g2, replace) graphregion(fcolor(white) lcolor(white)) title("Measures of globalization")
graph save "g2.gph", replace

graph combine g1 g2, rows(1) xsize(6) graphregion(fcolor(white) color(white))
graph export "SI_Figure_04.pdf", as(pdf) replace

*-----Robustness Checks Figures-----*

*Figure 7 (Same as reported in the main manuscript):
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(4.182561) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_07.pdf", as(pdf) replace
*Figure 8:
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(econ_glob) range(100) endtime(100) basetime(80) time(84) ///
		shock(4.363211) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_08.pdf", as(pdf) replace
		
*Figure 9 (same as reported in the main manuscript):
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(11.18479) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_09.pdf", as(pdf) replace
		
*Figure 10:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(CAP100) range(100) endtime(100) basetime(80) time(84) ///
		shock(10.84156) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_10.pdf", as(pdf) replace
		
*Figure 11:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(econ_glob) range(100) endtime(100) basetime(80) time(84) ///
		shock(5.475456) sig(95) id(id)
		
*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_11.pdf", as(pdf) replace
		
*Figure 12 (Same as reported in main manuscript):
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
		
*Run dynsimladderplot:	
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(13.00334) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_12.pdf", as(pdf) replace
		
*Figure 13:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
		
*Run dynsimladderplot:	
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(CAP100) range(100) endtime(100) basetime(80) time(84) ///
		shock(10.84156) sig(95) id(id)
		
*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_13.pdf", as(pdf) replace
		
*Figure 14:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(kaopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(.623701) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_14.pdf", as(pdf) replace

*Figure 15:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(econ_glob) range(100) endtime(100) basetime(80) time(84) ///
		shock(14.18345) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_15.pdf", as(pdf) replace


*Figure 16 (Same as reported in main manuscript):
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:		
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(4.600709) sig(95) id(id)

*Open dynsimpie simulation results and graph them (Figure 10):
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_16.pdf", as(pdf) replace

*Figure 17:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:	
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(CAP100) range(100) endtime(100) basetime(80) time(84) ///
		shock(9.831539) sig(95) id(id)
		
*Open dynsimpie simulation results and graph them (Figure 10):
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_17.pdf", as(pdf) replace
		
*Figure 18:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(kaopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(.9155273) sig(95) id(id)
		
*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_18.pdf", as(pdf) replace
		
*Figure 19:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(econ_glob) range(100) endtime(100) basetime(80) time(84) ///
		shock(5.257565 ) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_19.pdf", as(pdf) replace

*Figure 20:
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(6.477001) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_20.pdf", as(pdf) replace
		
*Figure 21:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_growth, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(11.18479) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_21.pdf", as(pdf) replace
		
		
*Figure 22:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
		
*Run dynsimladderplot:	
		dynsimladderplot cgdpo_growth, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(13.00334) sig(95) id(id)

*Open dynsimpie simulation results and graph them (Figure 9):
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_22.pdf", as(pdf) replace

*Figure 23:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:		
		dynsimladderplot cgdpo_growth, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(4.600709) sig(95) id(id)

*Open dynsimpie simulation results and graph them (Figure 10):
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_23.pdf", as(pdf) replace

*Figure 24:
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot tradeopen polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(cgdpo_pc_growth) range(100) endtime(100) basetime(80) ///
		time(84) shock(.0197716) sig(95) id(id)


*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_24.pdf", as(pdf) replace
		
*Figure 25:
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(polariz) range(100) endtime(100) basetime(80) time(84) ///
		shock(1.007905) sig(95) id(id)


*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_25.pdf", as(pdf) replace

*Figure 26:
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(polconiii) range(100) endtime(100) basetime(80) time(84) ///
		shock(.0100499) sig(95) id(id)


*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))	
graph export "SI_Figure_26.pdf", as(pdf) replace

*Figure 27:
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(execrlc) range(100) endtime(100) basetime(80) time(84) ///
		shock(1.007905) sig(95) id(id)


*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_27.pdf", as(pdf) replace
		
*Figure 28:
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"
*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus5_top) ///
		shockvar(agedep) range(100) endtime(100) basetime(80) time(84) ///
		shock(1.057319) sig(95) id(id)


*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-94" 6 "Top 5") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_28.pdf", as(pdf) replace
		
*Figure 29:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(cgdpo_pc_growth) range(100) endtime(100) basetime(80) ///
		time(84) shock(.0318341) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_29.pdf", as(pdf) replace
		
*Figure 30:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(polariz) range(100) endtime(100) basetime(80) time(84) ///
		shock(.8346836) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_30.pdf", as(pdf) replace
		
*Figure 31:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(polconiii) range(100) endtime(100) basetime(80) time(84) ///
		shock(.0343724) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_31.pdf", as(pdf) replace

*Figure 32:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(execrlc) range(100) endtime(100) basetime(80) time(84) ///
		shock(1.004494) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_32.pdf", as(pdf) replace
		
*Figure 33:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(agedep) range(100) endtime(100) basetime(80) time(84) ///
		shock(1.77507) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_33.pdf", as(pdf) replace

*Figure 34:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(cgdpo_pc_growth) range(100) endtime(100) basetime(80) ///
		time(84) shock(.0316306) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_34.pdf", as(pdf) replace
		
*Figure 35:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(polariz) range(100) endtime(100) basetime(80) time(84) ///
		shock(.3970613) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_35.pdf", as(pdf) replace
		
*Figure 36:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(polconiii) range(100) endtime(100) basetime(80) time(84) ///
		shock(.0200596) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_36.pdf", as(pdf) replace
		
*Figure 37:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(execrlc) range(100) endtime(100) basetime(80) time(84) ///
		shock(.8346836) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_37.pdf", as(pdf) replace
		
*Figure 38:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(agedep) range(100) endtime(100) basetime(80) time(84) ///
		shock(1.322301) sig(95) id(id)


*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-89" 6 "Top 10") ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_38.pdf", as(pdf) replace
		
*Figure 39:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(cgdpo_pc_growth) range(100) endtime(100) basetime(80) ///
		time(84) shock(.0587815) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_39.pdf", as(pdf) replace
		
*Figure 40:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(polariz) range(100) endtime(100) basetime(80) time(84) ///
		shock(.9112246) sig(95) id(id)
		
*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_40.pdf", as(pdf) replace
		
*Figure 41:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(polconiii) range(100) endtime(100) basetime(80) time(84) ///
		shock(.2145251) sig(95) id(id)
		
*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_41.pdf", as(pdf) replace
		
*Figure 42:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(execrlc) range(100) endtime(100) basetime(80) time(84) ///
		shock(1.013423) sig(95) id(id)
		
*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_42.pdf", as(pdf) replace
		
*Figure 43:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot tradeopen cgdpo_pc_growth polariz agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(agedep) range(100) endtime(100) basetime(80) time(84) ///
		shock(9.975751) sig(95) id(id)
		
*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_43.pdf", as(pdf) replace
		
*-----Numeric Tables-----*
*Table 5:
*Load US dataset:
use "US_Data.dta", clear
		set seed 784847
		gen second_firstquint = ln(Secondfifth/Lowestfifth)
		gen third_firstquint = ln(Thirdfifth/Lowestfifth)
		gen fourth_firstquint = ln(Fourthfifth/Lowestfifth)
		gen topminus1_firstquint = ln(topfifthminus5/Lowestfifth)
		gen top_firstquint = ln(Top5percent/Lowestfifth)

sureg (D.second_firstquint L.second_firstquint D.tradeopen L.tradeopen ///
 D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.third_firstquint L.third_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.fourth_firstquint L.fourth_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.topminus1_firstquint L.topminus1_firstquint D.tradeopen ///
L.tradeopen D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.top_firstquint L.top_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc)
est store A
esttab A using SI_Table_5.txt, replace se


*Table 6:
*Load Canada dataset:
use "Canada_Data.dta", clear
		set seed 784847
		gen second_firstquint = ln(secondquint/firstquint)
		gen third_firstquint = ln(thirdquint/firstquint)
		gen fourth_firstquint = ln(fourthquint/firstquint)
		gen topminus1_firstquint = ln(decile90/firstquint)
		gen top_firstquint = ln(decile100/firstquint)

sureg (D.second_firstquint L.second_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.third_firstquint L.third_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.fourth_firstquint L.fourth_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.topminus1_firstquint L.topminus1_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.top_firstquint L.top_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc)
est store A
esttab A using SI_Table_6.txt, replace se


*Table 7:
*Load Sweden dataset:
use "Sweden_Data.dta", clear
		set seed 784847
		gen second_firstquint = ln(secondquint/firstquint)
		gen third_firstquint = ln(thirdquint/firstquint)
		gen fourth_firstquint = ln(fourthquint/firstquint)
		gen topminus1_firstquint = ln(decile90/firstquint)
		gen top_firstquint = ln(decile100/firstquint)

sureg (D.second_firstquint L.second_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.third_firstquint L.third_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.fourth_firstquint L.fourth_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.topminus1_firstquint L.topminus1_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.top_firstquint L.top_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc)
est store A
esttab A using SI_Table_7.txt, replace se

*Table 8:
*Load Brazil dataset:
use "Brazil_Data.dta", clear
		set seed 784847
		gen second_firstquint = ln(secondquint/firstquint)
		gen third_firstquint = ln(thirdquint/firstquint)
		gen fourth_firstquint = ln(fourthquint/firstquint)
		gen topminus1_firstquint = ln(topdecileminus1/firstquint)
		gen top_firstquint = ln(top1_i/firstquint)
sureg (D.second_firstquint L.second_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.third_firstquint L.third_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.fourth_firstquint L.fourth_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.topminus1_firstquint L.topminus1_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc) ///
(D.top_firstquint L.top_firstquint D.tradeopen L.tradeopen ///
D.cgdpo_pc_growth L.cgdpo_pc_growth D.polariz L.polariz D.polconiii L.polconiii ///
D.agedep L.agedep D.execrlc L.execrlc)
est store A
esttab A using SI_Table_8.txt, replace se


*Figure 44:
use "Quick_Comparison.dta", clear
		set seed 784847

twoway line k_l year if year >1975 & year<2013 & country=="Brazil" , lpattern(dash) lwidth(medthick) || /*
*/ line k_l year if year >1975 & year<2013 & country=="Canada" , lpattern("-.") lwidth(medthick) || /*
*/ line k_l year if year >1975 & year<2013 & country=="Sweden" , lpattern(longdash) lwidth(medthick) || /*
*/ line k_l year if year >1975 & year<2013 & country=="US" , lpattern(solid) lwidth(medthick) || /*
*/ line k_l year if year >1975 & year<2013 & country=="Uruguay" , lpattern("- -") lwidth(medthick) || /*
*/ ,  /*
*/ legend(label (1 "Brazil") label (2 "Canada") label(3 "Sweden") label(4 "United States") label(5 "Uruguay")) /*
*/ scheme(burd) ytitle("Capital to Labor Ratio") xtitle("Year")
graph export "SI_Figure_44.pdf", as(pdf) replace

*Figure 45:
use "Uruguay_Data.dta", clear
		set seed 784847
global nomissing "firstquint_i != . & secondquint_i != . & thirdquint_i != . & fourthquint_ != . & topminus1_i != . & top1_i != . & cgdpo_pc_growth != . & polariz != ."

twoway line  firstquint_i year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line secondquint_i year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line thirdquint_i year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium)  || line ///
fourthquint_i year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || line topminus1_i year if $nomissing, ///
lcolor(black) lpattern(longdash_3dot) lwidth(medthick)  || line top1_i year if $nomissing, lcolor(black) ///
lpattern(shortdash) lwidth(medium) legend( symxsize(8) order(1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 ///
"80-99" 6 "Top 1") rows(1)) xtitle("Year") ytitle("Proportion of Income Share") xlabel(1980(5)2015) ///
ylabel(0(5)30, nogrid) name(g1, replace) graphregion(style(none) fcolor(white) lcolor(white)) title("Compositional DV")

twoway line tradeopen year if $nomissing, lcolor(black) lpattern(dash) lwidth(medium) ///
|| line econ_glob year if $nomissing, lcolor(black) lpattern(dot) lwidth(medthick)  || ///
line globaliz year if $nomissing, lcolor(black) lpattern(dash_dot) lwidth(medium) || ///
line CAP100 year if $nomissing, lcolor(black) lpattern(solid) lwidth(medium)  || ///
line kaopen year if $nomissing, lcolor(black) lpattern(longdash_3dot) lwidth(medthick) ///
legend(symxsize(8) order(1 "Openness" 2 "KOF Econ" 3 "KOF" 4 "Quinn" 5 "KAO") rows(1)) ///
xtitle("Year") ytitle("Measure of Globalization") ///
xlabel(1980(5)2015) ylabel(0(10)100, nogrid) name(g2, replace) graphregion(fcolor(white) lcolor(white)) title("Measures of globalization")

graph combine g1 g2, rows(1) xsize(6) graphregion(fcolor(white) color(white))
graph export "SI_Figure_45.pdf", as(pdf) replace

*Table 9: 
sutex firstquint_i secondquint_i thirdquint_i fourthquint_i topminus1_i top1_i ///
tradeopen CAP100 econ_glob kaopen cgdpo_pc_growth polconiii polariz execrlc k_l if $nomissing, ///
lab nobs key(descstat) replace /// 
file(SI_Table_9.txt) title("Summary Statistics---Uruguayan Dataset") minmax

*Figure 46:
*Load Uruguay dataset:
use "Uruguay_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(tradeopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(9.271975) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_46.pdf", as(pdf) replace
		
*Figure 47:
*Load Uruguay dataset:
use "Uruguay_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(CAP100) range(100) endtime(100) basetime(80) time(84) ///
		shock(4.805323) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_47.pdf", as(pdf) replace
		
*Figure 48:
*Load Uruguay dataset:
use "Uruguay_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(kaopen) range(100) endtime(100) basetime(80) time(84) ///
		shock(.659221) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_48.pdf", as(pdf) replace
		
*Figure 49:
*Load Uruguay dataset:
use "Uruguay_Data.dta", clear
		set seed 784847
do "dynsimpie.ado"
do "dynsimladderplot.ado"

*Run dynsimladderplot:
		dynsimladderplot cgdpo_pc_growth polariz polconiii agedep execrlc, ///
		dvs(first_top second_top third_top fourth_top topminus1_top) ///
		shockvar(econ_glob) range(100) endtime(100) basetime(80) time(84) ///
		shock(5.845869) sig(95) id(id)

*Open dynsimpie simulation results and graph them:
		use "dynsimpie_results", clear
		set seed 784847
		twoway rspike var_pie_ul_sr_ var_pie_ll_sr sort_sr, horizontal ///
		lcolor(black) || rspike var_pie_ul_lr_ var_pie_ll_lr_ sort_lr, ///
		horizontal lcolor(black) || scatter  sort_sr mid_sr, msymbol(T) ///
		mcolor("27 158 119") msize(medlarge) || scatter sort_lr mid_lr, ///
		msymbol(O) mcolor("117 112 179") msize(medlarge) xline(0, ///
		lcolor(black) lstyle(solid)) legend(order(3 "Short-Run" 4 "Long-Run")) ///
		ylabel( 1 "0-19" 2 "20-39" 3 "40-59" 4 "60-79" 5 "80-99" 6 "Top 1" ) ///
		xtitle("Expected Change from Baseline") plotregion(style(none)) ///
		yscale(axis(1) noline) xlabel(, grid glcolor(gs15))
graph export "SI_Figure_49.pdf", as(pdf) replace
